﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>AddUserInfoView</title>
    <link href="~/layuimini/lib/layui-v2.6.3/css/layui.css" rel="stylesheet" />
    <link href="~/layuimini/css/layuimini.css" rel="stylesheet" />
</head>
<body>


    <br />
    <br />
    <br />
    <div>
        <form class="layui-form" action="">
            <div class="layui-form-item">
                <label class="layui-form-label required">金额</label>
                <div class="layui-input-inline">
                    <input type="text" name="Amount" autocomplete="off" lay-verify="required" lay-reqtext="充值金额不能为空" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label required">充值方式</label>
                <div class="layui-input-block">
                    <input type="radio" name="Way" value="现金" title="现金" checked>
                    <input type="radio" name="Way" value="银行卡" title="银行卡">
                    <input type="radio" name="Way" value="网银" title="网银">
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">充值</button>
                </div>
            </div>
        </form>
    </div>

    <script src="~/layuimini/lib/layui-v2.6.3/layui.js"></script>
    <script>

        //页面加载完才执行里面的js代码

        layui.use('form', function () {
            var form = layui.form;
            layer = layui.layer,
                $ = layui.$;


            //监听提交
            form.on('submit(formDemo)', function (data) {					//异步请求添加菜单
                $.ajax({
                    url: "http://localhost:31861/api/UserInfo/AddTop_upMethod",
                    data: data.field,
                    type: "post",
                    success: function (result) {
                        if (result.isSuccess) {
                            var index = layer.alert("充值成功", {
                                title: '提示'
                            }, function () {
                                //关闭弹出层
                                layer.close(index);
                                var iframeIndex = parent.layer.getFrameIndex(window.name);
                                parent.layer.close(iframeIndex);

                                //刷新表格数据
                                parent.reLoadTable();
                            });
                            //其他业务
                        } else {
                            layer.msg(result.msg);
                        }
                    }
                });

                return false;
            });
        });
    </script>
</body>
</html>
